﻿using System.Linq;

using TraceView.Shared;

namespace TraceView.UI.Entities
{
    public sealed class SeverityInfo : FilterEntity
    {
        private Severity _severity;

        public SeverityInfo(Severity severity)
        {
            Severity = severity;
        }

        public Severity Severity
        {
            get { return _severity; }
            set { SetProperty(() => Severity, ref _severity, value); }
        }

        public override string KeyValue
        {
            get { return Severity.ToString(); }
        }
    }

    public sealed class SeverityCollection : FilterEntityCollection<SeverityInfo>
    {
        protected override bool TraceItemMatches(SeverityInfo item, TraceItem traceItem)
        {
            return item.Severity == traceItem.Severity;
        }
    }
}